module.exports = {
    publicPath: process.env.NODE_ENV === 'development' ? '/' : './',  //'./',
    outputDir: 'dist',
    configureWebpack: {
      resolve: {
        alias: {
          'assets': '@/assets',
          'common': '@/common',
          'components': '@/components',
          'network': '@/network',
          'views': '@/views',
          'plugins': '@/plugins',
        }
      },
    },
    devServer: {
      port: 9001
    },
    pluginOptions: { 
        electronBuilder: {
          builderOptions: {
            asar: false,
          },
        }
    },
    chainWebpack: config => {
        config.module
        .rule('less')
        .oneOf('vue')
        .use('px2rem-loader')
        .loader('px2rem-loader')
        .before('postcss-loader') // this makes it work.
        .options({ remUnit: 16, remPrecision: 2 })  // remUnit：让1rem对标多少px
        .end()  //这里就是引用插件
    }
  }